/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.xnyzc.lhy.common.component.config;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.collect.Maps;
import lombok.Data;

import javax.xml.bind.annotation.XmlTransient;
import java.util.Map;

/**
 * 全局配置类
 * @author wangshuo
 * @version 2018年1月5日
 */
@Data
public class GlobalConfig {

	public static final String END = "end";
	public static final String ARREARAGE = "arrearage";
	public static final String CANCEL = "cancel";
	public static final String ALL = "all";


	/**
	 * 顶部菜单
	 */
	public static final String TOP_MENU = "1";

	/**
	 * 是/否
	 */
	public static final String YES = "1";
	public static final String NO = "0";

	/**
	 * 对/错
	 */
	public static final String TRUE = "true";
	public static final String FALSE = "false";

	// 数据范围（1：所有数据；2：所在公司及以下数据；3：所在公司数据；4：所在部门及以下数据；5：所在部门数据；8：仅本人数据；9：按明细设置）
	public static final String DATA_SCOPE_ALL = "1";
	public static final String DATA_SCOPE_COMPANY_AND_CHILD = "2";
	public static final String DATA_SCOPE_COMPANY = "3";
	public static final String DATA_SCOPE_OFFICE_AND_CHILD = "4";
	public static final String DATA_SCOPE_OFFICE = "5";
	public static final String DATA_SCOPE_SELF = "8";
	public static final String DATA_SCOPE_CUSTOM = "9";

	public Long officeId;

	public Long userId;

	public Long roleId;

	public String companyId;

	public String name;

	public String loginName;

	public String mobile;

	private Long page;

	private Integer pageSize;

	public String businessModule;

	public String businessType;

	private String loginFlag;

	private String cityCode;

	/**
	 * 自定义SQL（SQL标识，SQL内容）
	 */
	protected Map<String, String> sqlMap;

	@JsonIgnore
	@XmlTransient
	public Map<String, String> getSqlMap() {
		if (sqlMap == null){
			sqlMap = Maps.newHashMap();
		}
		return sqlMap;
	}

	public void setSqlMap(Map<String, String> sqlMap) {
		this.sqlMap = sqlMap;
	}

}
